package com.wxx.design.composite;

/**
 * @author Jetwang
 * @version 1.0
 * @date 2022/4/21 20:38
 */
public class Course extends CatalogComponent{
    private String name;
    private double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CatalogComponent catalogComponent) {
        return this.name;
    }

    @Override
    public double getPrice(CatalogComponent catalogComponent) {
        return this.price;
    }

    @Override
    public void Print() {
        System.out.println("Course Name:" + name + ",Course Price:" + price);
    }
}
